<template>
  <div>
      <active-list :handle="false" :list="list.data"></active-list>
      <div class="page-box">
          <el-pagination
            background
            small
            :current-page="list.current_page"
            :page-size="list.per_page"
            layout="total, prev, pager, next, jumper"
            :total="list.total"
            @current-change="changePage"
          ></el-pagination>
        </div>
  </div>
</template>

<script>
import activeList from '../../active/list-table.vue';

export default {
    props : { member_id : {} },
    components:{ activeList },
    data(){
        return {
            list : {
                current_page : 1,
                data : []
            },
        }
    },
    mounted(){
        this.getData();
    },
    methods:{
        //获取活动列表
        getData(){
            this.ajaxs('user/getUserActiveList',{
                data:{member_id : this.member_id , page : this.list.current_page},
                success:(res) => {
                    this.list = res.msg;
                    for(var i in this.list.data) {
                        if(this.list.data[i].Cover.indexOf('?') == -1) {
                            this.list.data[i].Cover = this.list.data[i].Cover + '?x-oss-process=image/resize,h_300';
                        }
                    }
                }
            });
        },
        //分页
        changePage(e){
            this.list.current_page = e;
            this.getData();
        }
    }
}
</script>

<style>

</style>